home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / artisanNamedCommandSetup.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  20.3 KB  |  782 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. //  Alias|Wavefront Script File
  19. //  MODIFY THIS AT YOUR OWN RISK
  20. //
  21. //  Creation Date:  November 2000
  22. //
  23. //
  24. //  Procedure Name:
  25. //         artisanNamedCommandSetup  
  26. //
  27. //  Description:
  28. //      Name commands for all artisan/jasper tools. 
  29. //
  30. //  Input Arguments:
  31. //
  32. //  Return Value:
  33. //      None.
  34. //
  35.  
  36.  
  37. // ========================================================================
  38. // Help procedures and functions.
  39. // ========================================================================
  40.  
  41. proc string currentToolClass()
  42. //
  43. //    Description:
  44. //        Returns a name of the current tool.
  45. //
  46. {
  47.     string  $currentContext = `currentCtx`;
  48.     return `contextInfo -c $currentContext`;
  49. }
  50.  
  51. global proc int isArtisanCtx()
  52. //
  53. //    Description:
  54. //        Returns true if this is one of the new artisan tools.
  55. //
  56. {
  57.     string $tc = currentToolClass();
  58.     return $tc == "art3dPaint" 
  59.         || $tc == "artSelect"  
  60.         || $tc == "artAttr"
  61.         || $tc == "artAttrSkin"
  62.         || $tc == "artFluidAttr"
  63.         || $tc == "artUserPaint"
  64.         || $tc == "artAttrColorPerVertex";
  65. }
  66.  
  67. global proc string artisanCommand()
  68. //
  69. //    Description:
  70. //        Returns current artisan conttext command.
  71. //
  72. {
  73.     string    $currentTool = currentToolClass();
  74.     string    $artisanCmd = "";
  75.  
  76.     if ( $currentTool == "art3dPaint" ) {
  77.         $artisanCmd = "art3dPaintCtx";
  78.     }
  79.     else if ( $currentTool == "artSelect" ) {
  80.         $artisanCmd = "artSelectCtx";
  81.     }    
  82.     else if ( $currentTool == "artAttr" ) {
  83.         $artisanCmd = "artAttrCtx";
  84.     }    
  85.     else if ( $currentTool == "artAttrSkin" ) {
  86.         $artisanCmd = "artAttrCtx";
  87.     }    
  88.     else if ( $currentTool == "artFluidAttr" ) {
  89.         $artisanCmd = "artFluidAttrCtx";
  90.     }    
  91.     else if ( $currentTool == "artAttrColorPerVertex" ) {
  92.         $artisanCmd = "artAttrPaintVertexCtx";
  93.     }    
  94.     else if ( $currentTool == "artUserPaint" ) {
  95.         $artisanCmd = "artUserPaintCtx";
  96.     }    
  97.     return $artisanCmd;
  98. }
  99.  
  100. proc int isArtColorFeedbackCtx()
  101. //
  102. //    Description:
  103. //        Returns true if this is attibute paint context.
  104. //
  105. {
  106.     string $tc = currentToolClass();
  107.     return ( ($tc == "artAttr") || ($tc == "artAttrSkin") );
  108. }
  109.  
  110. // -------------------------------------------------------
  111. // Old Artisan Jasper tools suppor
  112. proc int isJasperPaintCtx()
  113. //
  114. //    Description:
  115. //        Returns true if this is one of the old artisan (jasper) tools.
  116. //
  117. {
  118.     string $tc = currentToolClass();
  119.     return $tc == "putty" 
  120.         || $tc == "selectPaint"
  121.         || $tc == "userPaint" 
  122.         || $tc == "wtPaint"
  123.         || $tc == "setEditPaint" 
  124.         || $tc == "attrPaint" 
  125.         || $tc == "paintColor"
  126.         || attrPaintInstCheckTool($tc);
  127. }
  128.  
  129. proc int isValuePaintCtx()
  130. //
  131. //    Description:
  132. //        Returns true if this is one of the old 
  133. //        artisan (jasper) value tools.
  134. //
  135. {
  136.     string $tc = currentToolClass();
  137.     return $tc == "userPaint" 
  138.         || $tc == "wtPaint" 
  139.         || $tc == "attrPaint"
  140.         || attrPaintInstCheckTool( $tc );
  141. }
  142.  
  143. proc string jasperCommand()
  144. {
  145.     string    $currentTool = currentToolClass();
  146.     string    $jasperCmd = "";
  147.  
  148.     if ( $currentTool == "putty" ) {
  149.         $jasperCmd = "puttyCtx";
  150.     }
  151.     else if ( $currentTool == "selectPaint" ) {
  152.         $jasperCmd = "selectPaintCtx";
  153.     }
  154.     else if ( $currentTool == "userPaint" ) {
  155.         $jasperCmd = "userPaintCtx";
  156.     }
  157.     else if ( $currentTool == "attrPaint" || 
  158.               attrPaintInstCheckTool($currentTool) ) 
  159.     {
  160.         $jasperCmd = "attrPaintCtx";
  161.     }
  162.     else if ( $currentTool == "wtPaint" ) {
  163.         $jasperCmd = "wtPaintCtx";
  164.     }
  165.     else if ( $currentTool == "setEditPaint" ) {
  166.         $jasperCmd = "setEditPaintCtx";
  167.     }
  168.     else if ( $currentTool == "paintColor" ) {
  169.         $jasperCmd = "paintColorCtx";
  170.     }
  171.  
  172.     return $jasperCmd;
  173. }
  174. // -------------------------------------------------------
  175.  
  176.  
  177. proc int isAdynPaintPanel()
  178. //
  179. //    Description:
  180. //        Returns true if this is Paint Effects context.
  181. //
  182. {
  183.     string $currentPanel = `getPanel -withFocus`;
  184.     return (`scriptedPanel -ex $currentPanel` &&
  185.     `scriptedPanel -q -type $currentPanel` == "dynPaintScriptedPanelType");
  186. }
  187.  
  188. proc int isDynWireContext()
  189. //
  190. //    Description:
  191. //        Returns true if this is Paint Effects context.
  192. //
  193. {
  194.     string $cc = `currentCtx`;
  195.     string $ct = `contextInfo -t $cc`;
  196.  
  197.     return ($ct == "Paint Effects");
  198. }
  199.  
  200.  
  201. proc dynPaintResize(string $sliderName)
  202. //
  203. //    Description:
  204. //
  205. {
  206.     if (isDynWireContext()) {
  207.         dynWireCtx -e -dbs $sliderName `currentCtx`;
  208.     }
  209.     if (isAdynPaintPanel()) {
  210.         global string $gDynPaintEditorName;
  211.         dynPaintCtx -e -dbs $sliderName `dynPaintEditor -q -drc $gDynPaintEditorName`;
  212.     }    
  213. }
  214.  
  215.  
  216.  
  217. global proc artisanToggleReflectionX(
  218.      string  $artCmd
  219. )
  220. //
  221. //    Description:
  222. //        Toggle reflection in X.
  223. //
  224. {
  225.     if ( isArtisanCtx() ) {
  226.         if ( $artCmd != "" ) {
  227.             string $cmd0 = $artCmd + " -q -reflectX `currentCtx`";
  228.             string $cmd1;
  229.             if ( eval($cmd0) ) { 
  230.                 $cmd1 = $artCmd + " -e -reflectX false "  + `currentCtx`;
  231.             } else {
  232.                 $cmd1 = $artCmd + " -e -reflectX true "  + `currentCtx`;
  233.             }
  234.             eval( $cmd1 );
  235.  
  236.             // Update the UI in all artisan tools.
  237.             if ( `checkBoxGrp -exists artReflectionChBox` ) {
  238.                 checkBoxGrp -e -v1 `eval $cmd0` artReflectionChBox;
  239.             }
  240.  
  241.             // Update the UI in 3d Paint tool.
  242.             if ( `checkBoxGrp -exists art3dReflectionChBox` ) {
  243.                 checkBoxGrp -e -v1 `eval $cmd0` art3dReflectionChBox;
  244.             }
  245.         }
  246.     }
  247. }
  248.  
  249. global proc artisanToggleReflectionY(
  250.      string  $artCmd
  251. )
  252. //
  253. //    Description:
  254. //        Toggle reflection in Y.
  255. //
  256. {
  257.     if ( isArtisanCtx() ) {
  258.         if ( $artCmd != "" ) {
  259.             string $cmd0 = $artCmd + " -q -reflectY `currentCtx`";
  260.             string $cmd1;
  261.             if ( eval($cmd0) ) { 
  262.                 $cmd1 = $artCmd + " -e -reflectY false "  + `currentCtx`;
  263.             } else {
  264.                 $cmd1 = $artCmd + " -e -reflectY true "  + `currentCtx`;
  265.             }
  266.             eval( $cmd1 );
  267.  
  268.             // Update the UI in all artisan tools.
  269.             if ( `checkBoxGrp -exists artReflectionChBox` ) {
  270.                 checkBoxGrp -e -v2 `eval $cmd0` artReflectionChBox;
  271.             }
  272.  
  273.             // Update the UI in 3d Paint tool.
  274.             if ( `checkBoxGrp -exists art3dReflectionChBox` ) {
  275.                 checkBoxGrp -e -v2 `eval $cmd0` art3dReflectionChBox;
  276.             }
  277.         }
  278.     }
  279. }
  280.  
  281. global proc artisanToggleReflectionZ(
  282.      string  $artCmd
  283. )
  284. //
  285. //    Description:
  286. //        Toggle reflection in Z.
  287. //
  288. {
  289.     if ( isArtisanCtx() ) {
  290.         if ( $artCmd != "" ) {
  291.             string $cmd0 = $artCmd + " -q -reflectZ `currentCtx`";
  292.             string $cmd1;
  293.             if ( eval($cmd0) ) { 
  294.                 $cmd1 = $artCmd + " -e -reflectZ false "  + `currentCtx`;
  295.             } else {
  296.                 $cmd1 = $artCmd + " -e -reflectZ true "  + `currentCtx`;
  297.             }
  298.             eval( $cmd1 );
  299.  
  300.             // Update the UI in all artisan tools.
  301.             if ( `checkBoxGrp -exists artReflectionChBox` ) {
  302.                 checkBoxGrp -e -v3 `eval $cmd0` artReflectionChBox;
  303.             }
  304.  
  305.             // Update the UI in 3d Paint tool.
  306.             if ( `checkBoxGrp -exists art3dReflectionChBox` ) {
  307.                 checkBoxGrp -e -v3 `eval $cmd0` art3dReflectionChBox;
  308.             }
  309.         }
  310.     }
  311. }
  312.  
  313.  
  314. global proc artisanReflectionMenu(
  315.     string     $artCmd
  316. )
  317. //
  318. //    Description:
  319. //        Create the reflection menu for 'u/ hotkey.
  320. //
  321. {
  322.     string $cmd  = $artCmd + " -q -reflectX `currentCtx`";
  323.     menuItem 
  324.         -label "Reflection X " 
  325.         -checkBox `eval($cmd)` 
  326.         -command ("artisanToggleReflectionX " + $artCmd );
  327.  
  328.     string $cmd = $artCmd + " -q -reflectY `currentCtx`";
  329.     menuItem 
  330.         -checkBox `eval($cmd)` 
  331.         -label "Reflection Y " 
  332.         -command ("artisanToggleReflectionY " + $artCmd );
  333.  
  334.     string $cmd = $artCmd + " -q -reflectZ `currentCtx`";
  335.     menuItem 
  336.         -checkBox `eval($cmd)` 
  337.         -label "Reflection Z " 
  338.         -command ("artisanToggleReflectionZ " + $artCmd );
  339. }
  340.  
  341.  
  342. proc artisanToolOperationMenu() 
  343. //
  344. //    Description:
  345. //        Create a context sensitive popmenu with all paint 
  346. //        oparations for all artisan tools.
  347. //
  348. {
  349.     string $tc = currentToolClass();
  350.  
  351.     // Get the proper artisan command for the tool.
  352.     string $artCmd = artisanCommand(); 
  353.  
  354.     if ( $tc == "art3dPaint"  ) {
  355.         popupMenu -mm 1 -b 1 -p viewPanes artOperationPopupMenu;
  356.             menuItem -rp "NW" -l "PFX Paint"
  357.                 -c ("art3dUpdatePaintOperation " + $artCmd + " \"effectsBrush\" \"Paint\";  ");
  358.             menuItem -rp "S" -l "Blur"
  359.                 -c ("art3dUpdatePaintOperation " + $artCmd + " \"effectsBrush\" \"Blur\";  ");
  360.             menuItem -rp "W" -l "Smear"
  361.                 -c ("art3dUpdatePaintOperation " + $artCmd + " \"effectsBrush\" \"Smear\";  ");
  362.             menuItem -rp "N" -l "Artisan Paint"
  363.                 -c ("art3dUpdatePaintOperation " + $artCmd + " \"artisanBrush\" \"Paint\";  ");
  364.             menuItem -rp "E" -l "Erase"
  365.                 -c ("art3dUpdatePaintOperation " + $artCmd + " \"artisanBrush\" \"Erase\";  ");
  366.             menuItem -rp "NE" -l "Clone"
  367.                 -c ("art3dUpdatePaintOperation " + $artCmd + " \"artisanBrush\" \"Clone\";  ");
  368.  
  369.             // Generate the reflection menu.
  370.             artisanReflectionMenu( $artCmd );
  371.     } 
  372.     else if ( $tc == "artSelect" ) { 
  373.         string $artCmd = "artSelectCtx";
  374.         popupMenu -mm 1 -b 1 -p viewPanes artOperationPopupMenu;
  375.             menuItem -rp "N" -l "Toggle"
  376.                 -c ("artSelectCtx -e -sop \"toggle\" `currentCtx`; ");
  377.             menuItem -rp "W" -l "Select"
  378.                 -c ("artSelectCtx -e -sop \"select\" `currentCtx`; ");
  379.             menuItem -rp "E" -l "UnSelect"
  380.                 -c ("artSelectCtx -e -sop \"unselect\" `currentCtx`; ");
  381.             menuItem -rp "S" -l "Select All"
  382.                 -c ("artSelectCtx -e -sal `currentCtx`; ");
  383.             // Generate the reflection menu.
  384.             artisanReflectionMenu( $artCmd );
  385.     } 
  386.     else if (( $tc == "artAttr" ) 
  387.     ||          ( $tc == "artFluidAttr" )
  388.     ||          ( $tc == "artAttrSkin" ))
  389.     {
  390.         string $artCmd = "artAttrCtx";
  391.         popupMenu -mm 1 -b 1 -p viewPanes artOperationPopupMenu;
  392.             menuItem -rp "N" -l "Add"
  393.                 -c ("artAttrCtx -e -sao \"additive\" `currentCtx`;");
  394.             menuItem -rp "S" -l "Scale"
  395.                 -c ("artAttrCtx -e -sao \"scale\" `currentCtx`; ");
  396.             menuItem -rp "W" -l "Smooth"
  397.                 -c ("artAttrCtx -e -sao \"smooth\" `currentCtx`;");
  398.             menuItem -rp "E" -l "Replace"
  399.                 -c ("artAttrCtx -e -sao \"absolute\" `currentCtx`;");
  400.  
  401.             // Generate the reflection menu.
  402.             artisanReflectionMenu( $artCmd );
  403.     }
  404.     else 
  405.         return;
  406.  
  407.     setParent ..;
  408. }
  409.  
  410. // ========================================================================
  411. // End of help procedures.
  412. // ========================================================================
  413. proc int pfxPanelIsActive()
  414. //
  415. //    Description:
  416. //        Determine if the mouse is over the paint effects panel 
  417. //        so we can decide which brush resize method to use.    
  418. //
  419. {
  420.     string $panelName = `getPanel -wf`; 
  421.  
  422.     // For now we can test the panel name, as we only
  423.     // have one paint effects panel. We could test
  424.     // for a scriptedPanel(below), but if someone develops an
  425.     // artisan scripted panel then this would not be sufficient.
  426.     // string $panelType = `getPanel -to $panelName`;
  427.     // if( $panelType == "scriptedPanel" )
  428.  
  429.     if( $panelName == "dynPaintScriptedPanel" ){
  430.         return( 1 );
  431.     } else {
  432.         return( 0 );
  433.     }
  434. }
  435.  
  436. global proc artActivateScreenSlider(
  437.     string $sliderName
  438. )
  439. //
  440. //    Description:
  441. //        Global procs for activating screen sliders 
  442. //        - sets the flag to activate them.
  443. //
  444. {
  445.     int $pfxFocus = pfxPanelIsActive();
  446.     // New Artisan Tools.
  447.     if ( isArtisanCtx() && !$pfxFocus ) {
  448.         string $artisanCmd = artisanCommand();
  449.         if( $sliderName == "upper_radius" ) {
  450.             artBaseCtx -e -dragSlider "radius" `currentCtx`;
  451.         } else if( $sliderName == "lower_radius" ) {
  452.             artBaseCtx -e -dragSlider "lowradius" `currentCtx`;
  453.         } else if( $sliderName == "opacity" ) {
  454.             artBaseCtx -e -dragSlider "opacity" `currentCtx`;
  455.         } else if( $sliderName == "value" ) {
  456.             artBaseCtx -e -dragSlider "value" `currentCtx`;
  457.         } else if( $sliderName == "stamp_depth" ) {
  458.             artBaseCtx -e -dragSlider "depth" `currentCtx`;
  459.         }
  460.     }
  461.     // Jasper tools - old artisan tools.
  462.     else if ( isJasperPaintCtx()  && !$pfxFocus) {
  463.         commonPaintCtx -e -slider $sliderName `currentCtx`;
  464.     }
  465.     // Paint Effects.
  466.     else if (`isTrue "MayaCreatorExists"`) 
  467.     {
  468.         if( $sliderName == "displacement" ) {
  469.             dynPaintResize("offset");
  470.         } else if( $sliderName == "lower_radius" ) {
  471.             dynPaintResize("width");
  472.         } else {
  473.             dynPaintResize("size");
  474.         }
  475.     }
  476. }
  477.  
  478.  
  479. global proc artDeactivateScreenSlider()
  480. //
  481. //    Description:
  482. //        Global procs for deactivating screen sliders - sets the flag to 
  483. //        deactivate them.
  484. //
  485. {
  486.     int $pfxFocus = pfxPanelIsActive();
  487.     // New Artisan Tools.
  488.     if ( isArtisanCtx()  && !$pfxFocus) {
  489.         artBaseCtx -e -dragSlider "none" `currentCtx`;
  490.     }
  491.     // Jasper tools - old artisan tools.
  492.     else if ( isJasperPaintCtx() && !$pfxFocus ) {
  493.         commonPaintCtx -e -slider "none" `currentCtx`;
  494.     }
  495.     // Paint Effects.
  496.     else if (`isTrue "MayaCreatorExists"`) 
  497.     {
  498.         dynPaintResize("none");
  499.     }
  500. }
  501.  
  502.  
  503. global proc artPaintOperationMenu()
  504. //
  505. //    Description:
  506. //        Display a popup menu with all artisan paint operations.
  507. //    
  508. //    NOTE: This is tool sensitive.
  509. //
  510. {
  511.     artDeletePopMenu();
  512.  
  513.     // New Artisan Tools.
  514.     if ( isArtisanCtx() ) {
  515.         artisanToolOperationMenu();
  516.     } 
  517.     // Jasper tools - old artisan tools.
  518.     else if ( isJasperPaintCtx() ) {
  519.         // Call the old stuff.
  520.         jasperBrushMode();
  521.     }
  522. }
  523.  
  524.  
  525. global proc artDeletePopMenu()
  526. //
  527. //    Description:
  528. //        
  529. //
  530. {
  531.     if ( isArtisanCtx() ) {
  532.         if (`popupMenu -exists artOperationPopupMenu`) {
  533.             deleteUI artOperationPopupMenu;
  534.         }
  535.  
  536.     }
  537.     // Jasper tools - old artisan tools.
  538.     else if ( isJasperPaintCtx() ) {
  539.         deletePopupMenu();
  540.     }
  541. }
  542.  
  543.  
  544. global proc artFloodSurfaces()
  545. //
  546. //    Description:
  547. //        Command to flood the surfaces with current values.
  548. //
  549. {
  550.     if ( isArtisanCtx() ) {
  551.         string $artisanCmd = artisanCommand();
  552.         if ( $artisanCmd != "" ) {
  553.             eval( $artisanCmd + " -e -clear `currentCtx`" );
  554.         }
  555.     }
  556.     // Old Artisan (Jasper) tools.
  557.     else if ( isJasperPaintCtx() ) {
  558.         string $jasperCmd = jasperCommand();
  559.         if ( $jasperCmd != "" ) {
  560.             eval( $jasperCmd + " -e -clear `currentCtx`" );
  561.         }
  562.     }
  563. }
  564.  
  565.  
  566. global proc artToggleWireframeDisplay()
  567. //
  568. //    Description:
  569. //         Toggle display of the wireframe - change the value into 
  570. //    the opposite one.
  571. //
  572. {
  573.     if ( isArtisanCtx() ) {
  574.         string $artisanCmd = artisanCommand();
  575.         if ( $artisanCmd != "" ) {
  576.             string $cmd0 = $artisanCmd + " -q -showactive `currentCtx`";
  577.             string $cmd1;
  578.             if ( eval($cmd0) ) { 
  579.                 $cmd1 = $artisanCmd + " -e -showactive false "  + `currentCtx`;
  580.             } else {
  581.                 $cmd1 = $artisanCmd + " -e -showactive true "  + `currentCtx`;
  582.             }
  583.             eval( $cmd1 );
  584.  
  585.             // Update the UI in all artisan tools.
  586.             if ( `checkBoxGrp -exists artShowActiveLinesChkBox`) {
  587.                 checkBoxGrp -e -v1 `eval($cmd0)` artShowActiveLinesChkBox;
  588.             }
  589.  
  590.             // Update the UI in 3d Paint tool.
  591.             if ( `checkBoxGrp -exists art3dShowActiveLinesChkBox`) {
  592.                 checkBoxGrp -e -v1 `eval($cmd0)` art3dShowActiveLinesChkBox;
  593.             }
  594.         }
  595.     }
  596.     // Old Artisan (Jasper) tools.
  597.     else if ( isJasperPaintCtx() ) {
  598.         string $cmd = "commonPaintCtx -q -showactive `currentCtx`";
  599.         if ( eval($cmd) ) { 
  600.             commonPaintCtx -e -showactive false `currentCtx`;
  601.         } else {
  602.             commonPaintCtx -e -showactive true `currentCtx`;
  603.         }
  604.     }
  605. }
  606.  
  607.  
  608. global proc artToggleColorFeedback()
  609. //
  610. //    Description:
  611. //         Toggle the color feedback display - change the value into the opposite.
  612. //
  613. {
  614.     if ( isArtColorFeedbackCtx() ) {
  615.         string $artisanCmd = artisanCommand();
  616.         if ( $artisanCmd != "" ) {
  617.             string  $cmd0 = $artisanCmd + " -q -colorfeedback `currentCtx`";
  618.             string  $cmd1;
  619.             if ( `eval($cmd0)` ) {
  620.                 $cmd1 = $artisanCmd + " -e -colorfeedback false " + `currentCtx`;
  621.             } else {
  622.                 $cmd1 = $artisanCmd + " -e -colorfeedback true " + `currentCtx`;
  623.             }
  624.             eval($cmd1);
  625.  
  626.             // Update the UI in artisan tools.
  627.             if ( `checkBoxGrp -exists artColorFeedbackChkBox`) {
  628.                 checkBoxGrp -e -v1 `eval($cmd0)` artColorFeedbackChkBox;
  629.             }
  630.         }
  631.     } 
  632.     // Old Artisan (Jasper) tools.
  633.     else if ( isJasperPaintCtx() ) {
  634.         if ( !isValuePaintCtx() ) { 
  635.             return; 
  636.         }
  637.  
  638.         string $cmd = "valuePaintCtx -q -colorfeedback `currentCtx`";
  639.         if ( eval($cmd) ) {
  640.             eval( "valuePaintCtx  -e -colorfeedback false `currentCtx`");
  641.         } else {
  642.             eval( "valuePaintCtx  -e -colorfeedback true `currentCtx`");
  643.         }    
  644.     }    
  645. }
  646.  
  647.  
  648. global proc artActivatePickColorMode()
  649. //
  650. //    Description:
  651. //        Activate pick color mode.
  652. //
  653. {
  654.     if ( isArtisanCtx() ) {
  655.         $cmd = artisanCommand() + " -e -pickColor true " + `currentCtx`;
  656.         eval($cmd);
  657.     }
  658.     // Old Artisan (Jasper) tools.
  659.     else if ( isJasperPaintCtx() ) {
  660.         commonPaintCtx -e -brushoperate "pickcolor" `currentCtx`;
  661.     }
  662. }
  663.  
  664.  
  665. global proc artDeactivatePickColorMode()
  666. //
  667. //    Description:
  668. //        Deactivate pick color mode.
  669. //
  670. {
  671.     if ( isArtisanCtx() ) {
  672.         $cmd = artisanCommand() + " -e -pickColor false " + `currentCtx`;
  673.         eval($cmd);
  674.     }
  675.     // Old Artisan (Jasper) tools.
  676.     else if ( isJasperPaintCtx() ) {
  677.         commonPaintCtx -e -brushoperate "paint" `currentCtx`;
  678.     }
  679. }
  680.  
  681. // ========================================================================
  682. // MAIN procedure - artisanNamedCommandSetup()
  683. // ========================================================================
  684.  
  685. global proc artisanNamedCommandSetup( )
  686. {
  687.     assignCommand -e -addDivider "Maya Artisan Tools";
  688.  
  689.     // Global named commands for Artisan tools.
  690.     nameCommand -annotation "Maya Artisan Operation, with Marking Menu (Press)"
  691.         -command ("PaintOperationMarkingMenuPress")
  692.     artisanPaintOperation_Tool;
  693.  
  694.     nameCommand -annotation "Maya Artisan Operation, with Marking Menu (Release)"
  695.         -command ("PaintOperationMarkingMenuRelease")
  696.     artisanPaintOperation_Tool_revert;
  697.  
  698.     nameCommand -annotation "Flood with the current value"
  699.         -command ("FloodSurfaces")
  700.     artisanToggleFlood_press;
  701.  
  702.     nameCommand -annotation "Toggle Wireframe ON/OFF"
  703.         -command ("ToggleWireframeInArtisan")
  704.     artisanToggleWireframe_press;
  705.  
  706.     nameCommand -annotation "Activate Pick Color Mode (Press)" 
  707.         -command ("PickColorActivate")
  708.     artisanPickColorMode_press;
  709.  
  710.     nameCommand -annotation "Deactivate Pick Color Mode (Release)" 
  711.         -command ("PickColorDeactivate")
  712.     artisanPickColorMode_release;
  713.  
  714.  
  715.     // Global named commands for activating/deactivating screen sliders.
  716.     nameCommand 
  717.         -ann "Activate Modify Lower Brush Radius (Press)/Modify Paint Effects Brush Size" 
  718.         -command ("ModifyLowerRadiusPress")
  719.     artisanModifyLowerRadius_press;
  720.  
  721.     nameCommand 
  722.         -ann "Deactivate Modify Lower Brush Radius (Release)" 
  723.         -command ("ModifyLowerRadiusRelease")
  724.     artisanModifyLowerRadius_release;
  725.  
  726.     nameCommand 
  727.         -ann "Activate Modify Upper Brush Radius (Press)/Modify Paint Effect Brush Scale" 
  728.         -command ("ModifyUpperRadiusPress")
  729.     artisanModifyUpperRadius_press;
  730.  
  731.     nameCommand 
  732.         -ann "Deactivate Modify Upper Brush Radius (Release)" 
  733.         -command ("ModifyUpperRadiusRelease")
  734.     artisanModifyUpperRadius_release;
  735.  
  736.     nameCommand 
  737.         -ann "Activate Modify Opacity (Press)"
  738.         -command ("ModifyOpacityPress")
  739.     artisanModifyOpacity_press;
  740.  
  741.     nameCommand 
  742.         -ann "Deactivate Modify Opacity (Release)"
  743.         -command ("ModifyOpacityRelease")
  744.     artisanModifyOpacity_release;
  745.  
  746.     nameCommand 
  747.         -ann "Activate Modify Value (Press)"
  748.         -command ("ModifyPaintValuePress")
  749.     artisanModifyValue_press;
  750.  
  751.     nameCommand -annotation "Deactivate Modify Value (Release)"
  752.         -command ("ModifyPaintValueRelease")
  753.     artisanModifyValue_release;
  754.  
  755.     nameCommand 
  756.         -ann "Activate Modify Stamp Depth (Press)"
  757.         -command ("ModifyStampDepthPress")
  758.     artisanModifyStampDepth_press;
  759.  
  760.     nameCommand -annotation "Deactivate Modify Stamp Depth (Release)"
  761.         -command ("ModifyStampDepthRelease")
  762.     artisanModifyStampDepth_release;
  763.  
  764.  
  765.     // Tool specific named commands.
  766.     nameCommand -annotation "Toggle Color Feedback ON/OFF"
  767.         -command ("ToggleColorFeedback")
  768.     artisanColorFeedback_press;
  769.  
  770.     // PolyBrush named commands
  771.     nameCommand
  772.         -annotation ("Poly Brush Operation, with Marking Menu")
  773.         -command ("PolyBrushMarkingMenu")
  774.     PolyBrushMarkingMenuNameCommand;
  775.  
  776.     nameCommand
  777.         -annotation ("Poly Brush Operation, with Marking Menu Pop Down")
  778.         -command ("PolyBrushMarkingMenuPopDown")
  779.     PolyBrushMarkingMenuPopDownNameCommand;
  780.  
  781. }
  782.